Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run multiple instances from same workspace #410

Merged
merged 2 commits into from
Jun 22, 2018
Merged

Conversation

pgarg66
Copy link
Contributor

@pgarg66 pgarg66 commented Jun 22, 2018

  • Support running leader and validators from multiple machines
    using the same NFS mounted workspace.
  • Changes to setup, leader and validator scripts

* Support running leader and validators from multiple machines
  using the same NFS mounted workspace.
* Changes to setup, leader and validator scripts
@@ -6,5 +6,13 @@ export RUST_LOG=${RUST_LOG:-solana=info}
set -x
[[ $(uname) = Linux ]] && sudo sysctl -w net.core.rmem_max=26214400

IPADDR="$(ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}')"

if [ -z "$IPADDR" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use bash's builtin [[ instead of [ (which is a program)
doing so saves you having to quote IPADDR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. will do

@@ -6,5 +6,13 @@ export RUST_LOG=${RUST_LOG:-solana=info}
set -x
[[ $(uname) = Linux ]] && sudo sysctl -w net.core.rmem_max=26214400

IPADDR="$(ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}')"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does ifconfig show on a Mac? Looks like you're working really hard here...
on stock Ubuntu this doesn't work (no ifconfig)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you try this on your mac:

ifconfig | awk '/inet(6)? (addr:)?/ {print $2}'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ifconfig | grep inet shows the following on Mac
inet 192.168.130.37 netmask 0xfffffc00 broadcast 192.168.131.255

On ubuntu it's this
inet addr:10.138.0.3 Bcast:10.138.0.3 Mask:255.255.255.255

Copy link
Contributor

@rob-solana rob-solana Jun 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend using all the IPs as match possibilities in the leader-${IP} selection

Looks like:

IPS=$(ifconfig | awk '/inet(6)? (addr:)?/ {print $2}')
for ip in $IPS
do
  [[ -f leader-${ip}.json ]] && break;
done
echo leader-${ip}.json

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't understand.. leader.sh is generating the file name based on the ip addr of the machine where it's running. How is $IPS computed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works on both Mac and ubuntu:
ifconfig | awk '/inet (addr)?/ {print $2}' | cut -d: -f2 | grep -v '127.0.0.1'

@sakridge
Copy link
Member

Isn't this essentially duplicated what -d option does? crdt::get_ip_addr()?

@garious garious merged commit 0253d34 into master Jun 22, 2018
@pgarg66
Copy link
Contributor Author

pgarg66 commented Jun 22, 2018

@sakridge and I talked offline. This change allows multiple validators (running on different VMs) from a same workspace (e.g. NFS mounted) to connect. This enables multiple validator JSON files to coexist in the same workspace.

@pgarg66 pgarg66 deleted the gce-multinode-scripts branch June 22, 2018 21:21
vkomenda pushed a commit to vkomenda/solana that referenced this pull request Aug 29, 2021
* Fix token-js docs

* Add Freeze/Thaw instructions

* Add v2 instructions

* Add new instructions to js test

* Bump @solana/spl-token to v0.0.8

* Fix didThrow and remove invalidApprove
wen-coding pushed a commit to wen-coding/solana that referenced this pull request Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants